<div ng-controller="Umbraco.Editors.Content.CopyController">
    <div class="umb-dialog-body form-horizontal">
        <div class="umb-pane">
            <p class="abstract" ng-hide="success">
                Choose where to copy <strong>{{currentNode.name}}</strong> to in the tree structure below
            </p>

            <div class="umb-loader-wrapper" ng-show="busy">
                <div class="umb-loader"></div>
            </div>

            <div ng-show="error">
                <h5 class="text-error">{{error.errorMsg}}</h5>
                <p class="text-error">{{error.data.message}}</p>
            </div>

            <div class="alert alert-success" ng-show="success">
                <p>
                    <strong>{{currentNode.name}}</strong> was copied to
                    <strong>{{target.name}}</strong>
                </p>

                <button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
            </div>

            <div ng-hide="success">

                <umb-tree-search-box hide-search-callback="hideSearch"
                                     search-callback="onSearchResults"
                                     search-from-id="{{searchInfo.searchFromId}}"
                                     search-from-name="{{searchInfo.searchFromName}}"
                                     show-search="{{searchInfo.showSearch}}"
                                     section="{{section}}">
                </umb-tree-search-box>

                <br />

                <umb-tree-search-results ng-if="searchInfo.showSearch"
                                         results="searchInfo.results"
                                         select-result-callback="selectResult">
                </umb-tree-search-results>

                <div ng-hide="searchInfo.showSearch">
                    <umb-tree section="content"
                              hideheader="false"
                              hideoptions="true"
                              isdialog="true"
                              eventhandler="dialogTreeEventHandler"
                              enablecheckboxes="true">
                    </umb-tree>
                </div>

                <umb-pane>
                    <umb-control-group label="Relate to original">
                        <input type="checkbox" ng-model="$parent.$parent.relateToOriginal" />
                    </umb-control-group>
                </umb-pane>

                <umb-pane>
                    <umb-control-group label="Include descendants">
                        <input type="checkbox" ng-model="$parent.$parent.recursive" />
                    </umb-control-group>
                </umb-pane>

            </div>
        </div>
    </div>

    <div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
        <a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
            <localize key="general_cancel">Cancel</localize>
        </a>
        <button class="btn btn-primary" ng-click="copy()" ng-disabled="busy">
            <localize key="actions_copy">Copy</localize>
        </button>
    </div>
</div>